package com.fs.controller;

import com.fs.service.GoodsCartService;
import com.fs.service.GoodsSerivce;
import com.fs.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/home")
public class HomeController {

    @Autowired
    private GoodsSerivce goodsSerivce;

    @GetMapping("/goods")
    public ResultVO getHomeGoods(){
        return goodsSerivce.getGoodsList();
    }

    @GetMapping("/goodsInfo/{id}")
    public ResultVO goodsInfo(@PathVariable("id") Integer id){
        return goodsSerivce.goodsInfo(id);
    }

}
